using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.XPath;
using Eclipse.TRCore.Http;
using Eclipse.TRCore.Http.DOMParser.Sgml;

namespace Eclipse.TRCore.Travians.Actions
{
    public abstract class TravianAction<I, R> : BaseAction<I, R> where I : new() where R :new()
    {
        protected static XPathNavigator GetSgmlDOM(string html)
        {
            using(SgmlReader reader = new SgmlReader())
            {
                using(StringReader sreader = new StringReader(html))
                {
                    reader.InputStream = sreader;
                    reader.DocType = "HTML";
                    XPathDocument doc = new XPathDocument(new StringReader(reader.ReadOuterXml()));
                    return doc.CreateNavigator();
                }
            }
        }
    }
}
